package thread;

import javax.microedition.lcdui.Image;

import midlets.ConexaoWebServer;
import midlets.DropAllBases;



public class Carregando extends Thread{

	private boolean parar = false;

	private String [] arrayCaracteres = new String [] {"A","Ag","Agu","Agua","Aguar","Aguard","Aguarde","Aguarde.","Aguarde..","Aguarde..."};
	
	
	public void run() {
		
		
		if(parar){
			ConexaoWebServer.alert1.setTitle(arrayCaracteres[9]);
		}
			
		//int i = 1;
		int i = 0;
		while(!parar){

			try{
				
				Thread.sleep(200);
				
				/*
				ConexaoWebServer.alert1.getImage();
				//ConexaoWebServer.alert1.setImage(ConexaoWebServer.img1 = Image.createImage("/imagens/wait"+i+".gif"));
				ConexaoWebServer.alert1.setImage(Image.createImage("/imagens/wait"+i+".gif"));
				*/
				ConexaoWebServer.alert1.setTitle(arrayCaracteres[i]);
				
	        }
			catch(Exception e){
				e.printStackTrace();
			}

			
		++i;
		/*
		if(i > 7){
			i = 1;
		}
		*/
		if(i == 9){
			i = 0;
		}
		
		}
	}

	public void quit() {
		parar = true;
	}

}
